package service;

import Util.SqlSessionUtil;
import dao.ZhejiangPriceIndexMapper;
import domain.ZhejiangPriceIndex;
import org.apache.ibatis.session.SqlSession;

import java.util.*;

public class ZhejiangPriceIndexService {
    public List<ZhejiangPriceIndex> selectByCityAndConsumeOrPrice(String city) {
        SqlSession session = SqlSessionUtil.getSession().openSession();
        ZhejiangPriceIndexMapper operation = session
                .getMapper(ZhejiangPriceIndexMapper.class);
        List<ZhejiangPriceIndex> zjpiList = operation.selectByCityAndConsumeOrPrice(city);
        session.commit();
        session.close();
        return zjpiList;
    }

    public static void main(String[] args) {
        ZhejiangPriceIndexService z = new ZhejiangPriceIndexService();
        System.out.println(z.selectByCityAndConsumeOrPrice("宁波市"));

    }
}
